package com.mecuros.demo.api.feign;

import com.mecuros.common.core.constant.SecurityConstants;
import com.mecuros.common.core.constant.ServiceNameConstants;
import com.mecuros.common.core.util.R;
import com.mecuros.demo.api.entity.SysLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author yujianbo
 * @Classname RemoteLogService
 * @Description 日志收集
 * @Date 2022/4/17 10:08 下午
 */
@FeignClient(contextId = "remoteLogService",value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteLogService {



    /**
     * 保存日志
     * @param sysLog 日志实体
     * @param from 内部调用标志
     * @return succes、false
     */
    @PostMapping("/log")
    R<Boolean> saveLog(@RequestBody SysLog sysLog, @RequestHeader(SecurityConstants.FROM) String from);

}
